export const login = ({ username, password }) => {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      if (username === 'test' && password === '123123') {
        resolve({
          username,
          avatarUrl: 'http://xxxx.com/1.jpg',
          token: 'adsadasdasdasdasdasd'
        })
      } else {
        const error = new Error('用户或密码错误')
        reject(error)
      }
    }, 0)
  })
}
